<td valign="top">
	<div class="right_title" style="border-bottom:none">
		<div class="font12 b" style="line-height:24px;">&nbsp;&nbsp;品牌管理</div>
	</div>
	<div class="border"  style=" width:97%; height:680px;border-top:none">
		<div class="searchTitle">查询条件</div>
		<table border="0" cellpadding="0" cellspacing="0" width="100%">
			<form action="<?php echo $this->createUrl("testproducts/index")?>" name="form" method="post">
			<tr>
				<td>&nbsp;&nbsp;&nbsp;名称:<input type="text" name="keyword" value="" /></td>
				<td align="right">
					<input type="submit" name="searchBtn" value="查询"/>
					<input type="button" name="OKbtn" id="OKbtn" value="提交选中产品到正式库"/>
					&nbsp;&nbsp;&nbsp;
				</td>
			</tr> 
			</form>
		</table>
		<div class="tabHead">
		&nbsp;列表
		</div>
		<table width="100%" border="0" cellpadding="0" cellspacing="0" id="content" style="margin:0 auto">
			<tr height="25" align="center" bgcolor="#EFEFEF">
				<th>选择</th>
				<th>名称</th>
				<th>图片</th>
				<th>描述</th>
				<th>网址</th>
				<th>操作</th>
			</tr>
			<?php foreach($data["data"] as $k=>$v){?>
			<tr height="25" align="left">
				<td><input type="checkbox" name="select" value="<?php echo $v["id"]?>"/></td>
				<td style="padding-left:10px"><?php echo $v["name"];?></td>
				<td><img src="<?php echo Yii::app()->baseUrl.'/'.$v["imgPath"];?>" border="0" width="80" height="80"/></td>
				<td><?php echo $v["intro"]?></td>
				<td><?php echo $v["webSite"]?></td>
				<td>
				<a href="<?php echo $this->createUrl("testproducts/modify",array("id"=>$v["id"]))?>">编辑</a> 
				<a href="javascript:void(0)" onclick="del('<?php echo $this->createUrl("shopbrand/delete",array("id"=>$v["id"]))?>')">删除</a>
				</td>
			</tr>
			<?php }?>
			<tr height="25" align="center" bgcolor="#EFEFEF">
				<td colspan="6"><?php echo $data["assign"]?></td>
			</tr>
		</table>
		
	</div>
</td>
<script>
$(document).ready(function(){
	$("#OKbtn").click(function(){
		var valArr = new Array();
		$("input[type=checkbox]").each(function(){
			//alert($(this).val());
			if($(this).attr("checked")){
				valArr.push($(this).val());
			}
		});
		var url = "<?php echo $this->createUrl("testproducts/confirm")?>";
		var data = "ids="+valArr.join(',');
		$.post(url,data,function(s){
			if(s == 1){
				alert("更新成功！");
				return true;
			}else{
				alert("更新失败！");
				return false;
			}
		})
	});
});

function del(url){
	if(!confirm("一但删除将不可恢复，是否确认删除？")){
		return false;
	}
	window.location = url;
}
</script>